package com.kayt.cyberBar.cpublic.business.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.kayt.cyberBar.common.PageData;
import com.kayt.cyberBar.common.ServerResponse;
import com.kayt.cyberBar.cpublic.business.entity.po.CPublicExamType;
import com.kayt.cyberBar.cpublic.business.entity.req.vo.PublicExamTypeReqVO;
import com.kayt.cyberBar.cpublic.business.entity.rsp.vo.PublicExamTypeRspVO;
import com.kayt.cyberBar.cpublic.business.server.IPublicExamTypeServer;
import com.kayt.cyberBar.cpublic.business.service.IPublicExamTypeService;

@Service("publicExamTypeService")
public class PublicExamServiceImpl implements IPublicExamTypeService{
	@Autowired
	private IPublicExamTypeServer publicExamTypeServer;
	@Override
	public ServerResponse<PageData<PublicExamTypeRspVO>> getExamTypeList() {
		PageData<CPublicExamType> examTypePageData = publicExamTypeServer.get_examType_list();
		return publicExamTypeServer.assemble_result_list(examTypePageData);
	}

	@Override
	public ServerResponse<PublicExamTypeRspVO> addExamType(PublicExamTypeReqVO examTypeReqVO) {
		CPublicExamType examType = publicExamTypeServer.add_examType(examTypeReqVO);
		return publicExamTypeServer.assemble_result(examType);
	}

	@Override
	public ServerResponse<PublicExamTypeRspVO> updateExamType(PublicExamTypeReqVO examTypeReqVO) {
		CPublicExamType examType = publicExamTypeServer.mod_examType(examTypeReqVO);
		return publicExamTypeServer.assemble_result(examType);
	}

	@Override
	public ServerResponse<String> deleteExamType(String examTypeId) {
		Integer result = publicExamTypeServer.del_examType(examTypeId);
		return publicExamTypeServer.assemble_result_string(result);
	}
}
